import pandas as pd

ko_abunds = pd.read_csv("../../data/stool/ko_abundance_table.tsv", sep='\t', index_col=0)
ko_abunds_rel = ko_abunds.div(ko_abunds.sum()) # convert to relative abundance
# ko_abunds_rel = ko_abunds_rel.loc[(ko_abunds_rel > 0).sum(axis=1) > 10] # remove KOs not seen in at least 10 samples
ko_abunds_rel.to_csv("../../data/stool/ko_abundance_table.rel.tsv", sep='\t')
